package pack1;

import java.util.List;
import java.util.concurrent.TimeUnit;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.support.ui.Select;

public class sprg13 {
public static void main(String[] args) {
	WebDriver driver=new FirefoxDriver();
	driver.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);
	driver.get("file:///C:/Users/anand/Desktop/tst.html");
 WebElement listBox = driver.findElement(By.name("tech"));
   Select select=new Select(listBox);
    List<WebElement> allOptions = select.getOptions();
String status="not found";


    for(int i=allOptions.size()-1;i>0;i--)
    	{   String s = allOptions.get(i).getText();
    	System.out.println(s);
    	if("tea".equals(s))
    	{
    	status="element found ";
    	break;
    	}
    	}
    System.out.println(status);
}
}
